package validate

import (
	"fmt"
	"github.com/gin-gonic/gin/binding"
	"github.com/go-playground/validator/v10"
)

// / 扩展自定义校验器
func init() {
	if v, ok := binding.Validator.Engine().(*validator.Validate); ok {
		v.RegisterValidation("email", func(fl validator.FieldLevel) bool {
			fval := fl.Field().Interface().(string)
			fmt.Println("------fval=", fval)

			return true
		})

	}
}
